package org.ccay.demo.student.enumerable;

import org.ccay.enumerable.EnumI18nUtil;
import org.ccay.enumerable.EnumItem;
import org.ccay.enumerable.EnumUtil;
import org.ccay.enumerable.SourceEnum;

public enum HobbyEnum implements EnumItem<HobbyEnum>{
	BASKETBALL("1","篮球"),
	SWIMMING("2","游泳");
	
	private String value;
	private String displayValue;

	private HobbyEnum(String value, String displayValue){
		this.value = value;
		this.displayValue = displayValue;
	}
	
	@Override
	public String getType() {
		return this.getClass().getSimpleName();
	}
	

	@Override
	public int getIndex() {
		return ordinal();
	}

	@Override
	public String getName() {
		return this.name();
	}

	@Override
	public String getValue() {
		return value;
	}
	
	@Override
	public EnumItem<HobbyEnum> fromValue(String value) {
		return EnumUtil.getInstance().getByTypeValue(getType(),  getValue());
	}

	@Override
	public String getDisplayValue() {
		return displayValue;
	}

	@Override
	public String getSource() {
		return SourceEnum.SOURCE_JAVA.getValue();
	}

	@Override
	public String getDisplayValue(String language) {
		return EnumI18nUtil.getI18nName(this, language);
	}

}
